﻿using M.Warehouse.API.Application.Command.FinishedProductCommand;
using M.Warehouse.Repository.WarehouseInterface;
using MediatR;

namespace M.Warehouse.API.Application.CommandHandlers.FinishedProductHandlers
{
    public class FinishedProductUpdateCommandHandlers : IRequestHandler<FinishedProductUpdateCommand, int>
    {
        private readonly IFinishedProductRepository _finishedProductRepository;
        public FinishedProductUpdateCommandHandlers(IFinishedProductRepository finishedProductRepository)
        {
            _finishedProductRepository = finishedProductRepository;
        }
        public async Task<int> Handle(FinishedProductUpdateCommand request, CancellationToken cancellationToken)
        {
            return await _finishedProductRepository.Update(request);
        }
    }
}
